//
//  MAKCollectionViewCell.h
//  MAKCommon
//
//  Created by zhuwh on 2020/3/27.
//  Copyright © 2020 mark. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MAKCollectionViewCellModel.h"

NS_ASSUME_NONNULL_BEGIN

@protocol MAKCollectionViewCellModel;

@protocol MAKCollectionViewCell <NSObject>

@required
/**
 绑定数据

 */
- (void)bindCellModel:(id<MAKCollectionViewCellModel>)cellModel withIndexPath:(NSIndexPath *)indexPath;

@optional
+ (CGSize)sizeForCellModel:(id<MAKCollectionViewCellModel>)cellModel constrainedToSize:(CGSize)size;

@end

@protocol MAKCellHasCollectionViewDelegate <NSObject>

- (void)mak_collectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)atIndexPath didSelectItemAtIndexPath:(NSIndexPath *)indexPath model:(id)model cellClass:(NSString *)cellClass;

- (void)mak_collectionView:(UICollectionView *)collectionView atIndexPath:(NSIndexPath *)atIndexPath didSelectItemAtIndexPath:(NSIndexPath *)indexPath model:(id)model actionId:(NSInteger)actionId;

@end


@interface MAKCollectionViewCell : UICollectionViewCell<MAKCollectionViewCell>

@property (nonatomic, strong) MAKCollectionViewCellModel *cellModel;
@property (nonatomic, weak) id<MAKCellHasCollectionViewDelegate> cellHasCollectionViewDelegate;

@end

NS_ASSUME_NONNULL_END
